package com.spring.hendler;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;

public class MyBeanPostProcessor implements BeanPostProcessor {

    //Bean初始化之前进行调用
    public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
        System.out.println(beanName+"BeforeInitialization .........");
        return bean;
    }
    //Bean初始化之后进行调用
    public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
        System.out.println(beanName + "AfterInitialization.........");
        return bean;
    }
}
